<?php
$typeName = pc_variable("typeName");
$entity = pc_variable("entity");
$typeConfig = pc_config("cm.type." . $typeName);
pc_pagelet("layout", 
    array(
        "title" => $entity != null ? pc_message("showEntity.title", array(
            pc_message("namespace." . $typeName),
            $entity->get($typeConfig->getPrimaryPropertyName()))) : 
            pc_message("showEntity.titleNew", array(pc_message("namespace." . $typeName))),
        "section" => "show-entity"
    ));